﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HUBS1.HCMS.Entity;
using HUBS1.HCMS.Data;

namespace HUBS1.HCMS.SqlClient
{
    public class sql_hcountry
    {
        /// <summary>
        /// 获得所有国家信息
        /// </summary>
        /// <param name="languagetype">语言选择</param>
        /// <returns></returns>
        public List<h_country> getcountry(int languagetype)
        {
            return ExecSql.GetTableList<h_country>("select * from h_country");
        }
        public bool deletecountry(int id)
        {
            return (ExecSql.SqlExecNoquery("delete from h_country where countryid=" + id.ToString()) > 0) ? true : false;
        }

        public h_country getitem(int id)
        {
            return new h_country(ExecSql.GetDataSet("select * from h_country where countryid="+id.ToString()).Tables[0].Rows[0]);
        }

        public bool insertorupdate(h_country _country)
        {
            return ExecSql.InsertOrUpdateData<h_country>(_country);
        }
    }
}
